package com.eight.travel.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.travel.pojo.StoreCom;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StoreComMapper extends BaseMapper<StoreCom> {

    //修改用户评论(实时修改，并获取当前时间)
    int updateStoreCom(StoreCom storeCom);

    //分页查看所有评论
    @Select("select * from storecom where sid = #{param1} ")
    List<StoreCom> selectAll(Integer sid);

    //查询总条数
    @Select("select count(*) from storecom")
    int selectRow();

    //添加评论（实时获取当前时间）
    @Insert("INSERT INTO storecom VALUES(null, #{storecominfo}, #{uid}, #{sid}, NOW())")
    int addStoreCom(StoreCom storeCom);

}
